﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:my="clr-namespace:Unimaq.Macroprocesos.WPFLibreriasClases;assembly=Unimaq.Macroprocesos.WPFLibreriasClases" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        mc:Ignorable="d" 
        x:Class="MacroprocesosWPF.Usuario.Principal"
        xmlns:l="clr-namespace:MacroprocesosWPF.Usuario"    
        Title="Principal" Height="626" Width="893" Loaded="Window_Loaded_1"        
        >
    <Window.Resources>
        <Style x:Key="MyFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Control}">
                        <Grid Margin="8">
                            <Ellipse Name="r1" Stroke="Black" StrokeDashArray="2 2" StrokeThickness="1"/>
                            <Border Name="border" Width="{TemplateBinding ActualWidth}" Height="{TemplateBinding ActualHeight}"
                                BorderThickness="1" CornerRadius="2"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="CircleButton" TargetType="Button">
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="Margin" Value="2"/>
            <Setter Property="FocusVisualStyle" Value="{StaticResource MyFocusVisual}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <Ellipse Stroke="#FF2F4160" StrokeThickness="4"/>
                            <Ellipse Margin="1" x:Name="highlightCircle" Fill="#FFF6F7F8" />
                            <ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center" TextBlock.Foreground="#FF2F4160" />
                        </Grid>
                        <ControlTemplate.Triggers>                            
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="highlightCircle" Property="Fill" Value="#FFF6F7F8" />
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                                <Setter TargetName="highlightCircle" Property="Fill" Value="#FF2F4160" />
                                <Setter TargetName="content" Property="TextBlock.Foreground" Value="#FFF6F7F8" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <DataTemplate x:Key="listBoxTemplate">
            <StackPanel Margin="3" >
                <DockPanel>
                    <Image DockPanel.Dock="Right" />
                    <StackPanel DockPanel.Dock="Left">
                        <TextBlock Text="{Binding Codigo}" FontSize="13" FontWeight="Thin" Margin="0,5,0,0" />
                        <TextBlock Text="{Binding Nombre}" FontSize="18" FontWeight="Thin" Margin="0,0,0,5" />
                    </StackPanel>
                </DockPanel>
            </StackPanel>
        </DataTemplate>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="250" />
            <ColumnDefinition Width="3" />
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid Grid.Column="0" x:Name="leftPanel">
            <Grid.Background>
                <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                    <GradientStop Color="#FF293955" Offset="1" />
                    <GradientStop Color="White" Offset="0" />
                    <GradientStop Color="#FF5E7EB7" Offset="0.91" />
                </LinearGradientBrush>
            </Grid.Background>
            <TreeView Margin="6,10,6,14" x:Name="treeMacroprocesos" SelectedItemChanged="treeMacroprocesos_SelectedItemChanged">
                <TreeView.Resources>
                    <Style TargetType="{x:Type TreeViewItem}">
                        <Setter Property="HeaderTemplate">
                            <Setter.Value>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="{Binding}" Margin="5,0" FontSize="14"/>                                                                                    
                                    </StackPanel>
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </TreeView.Resources>
            </TreeView>
        </Grid>
        <GridSplitter Grid.Row="0" Grid.Column="1" Background="#FF293955" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                       Width="Auto" Height="Auto" Grid.RowSpan="2" ResizeDirection="Columns"/>
        <Grid x:Name="gridContenido" Grid.Column="2" Opacity="1">
            <Grid.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF293955" Offset="1" />
                    <GradientStop Color="White" Offset="0" />
                    <GradientStop Color="#FF5E7EB7" Offset="0.967" />
                    <GradientStop Color="#FF95AAD0" Offset="0.926" />
                    <GradientStop Color="#FFCDD7E8" Offset="0.902" />
                </LinearGradientBrush>
            </Grid.Background>
            <Grid Margin="6,9,6,17" x:Name="PanelMacroprocesos">
                <Label Content="Macroprocesos UNIMAQ" Height="40" HorizontalAlignment="Left" Margin="10,9,0,0" x:Name="lblTitulo" VerticalAlignment="Top" FontSize="22" FontWeight="Thin" />                
                <Grid Name="panelContent" Margin="10,98,10,0">
                    <ListBox x:Name="ListaProcesos2" ItemTemplate="{StaticResource listBoxTemplate}" MouseDoubleClick="ListaProcesos2_MouseDoubleClick" BorderThickness="0" />
                </Grid>
                <Button x:Name="btnSubir" Content="Subir" Style="{StaticResource CircleButton}" Margin="0,44,66,0" VerticalAlignment="Top" HorizontalAlignment="Right" Width="40" Height="40" Click="btnSubir_Click"/>
                <Button x:Name="btnInicio" Content="Inicio" Style="{StaticResource CircleButton}" Margin="0,44,10,0" VerticalAlignment="Top" HorizontalAlignment="Right" Width="40" Height="40" Click="btnInicio_Click"/>
            </Grid>
        </Grid>
    </Grid>
</Window>
